home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 19.zip
/
BS1 part 19
/
how to learn assembler.adf
/
CH5
/
5_2timimg_test.asm
< prev
next >
Wrap
Assembly Source File
|
1988-02-25
|
784b
|
28 lines
;(5.2) timing
test:
bsr gettime ;Put cuttent time in D&
move.l d7,d6 ;save it in d6
bsr routine ;routine to be timed
bsr gettime ;get time again sub.l d6,d7 ;elpased time in 1/50 seconds in d7!
nop ;breakpoint here
routine:
move.l #500,d0 ;counter
loop:
dbra d0,loop ;delay count down
rts
gettime:
move.b $bfea0a,d7 ;Hi-byte in d0
lsl.l #4,d7 ; shift twice by 4 bits
lsl.l #4,d7 ;(8 bits shifted)
move.b $bf901,d7 ;get mid-byte
lsl.l #4,d7
lsl.l #4,d7 ;shift again
move.b $bfe901,d7 ;get lo-byte
rts
end